package com.facade.facade;

/**
 * 影院的外观
 * 这个类依赖所有的子系统 ，
 */
public class TheaterFacade {

    //DVD
    private DVDPlayer dvdPlayer;
    //爆米花机
    private Popcorn popcorn;
    //投影仪
    private Projector projector;
    //大屏幕
    private Screen screen;

    //下面准备几个影院开始工作的流程
    public void ready() {
        System.out.println("------- 开始准备 -------");
        dvdPlayer = DVDPlayer.getInstance();
        popcorn = Popcorn.getInstance();
        projector = Projector.getInstance();
        screen = Screen.getInstance();
    }

    public void on() {
        System.out.println("------- 设备开机 -------");
        dvdPlayer.on();
        popcorn.on();
        projector.on();
        screen.down();
    }

    public void play() {
        System.out.println("------- 设备运行 -------");
        dvdPlayer.play();
        projector.play();
        projector.play();
    }

    public void off() {
        System.out.println("------- 关机下班 -------");
        dvdPlayer.off();
        projector.off();
        popcorn.off();
        screen.up();
    }
}
